#define _CRT_SECURE_NO_WARNINGS


#include		<stdio.h>
#include		<stdlib.h>
#include		<time.h>
#include		<math.h>
#include		<string.h>
#include		<ctype.h>
#include        <assert.h>
#include		<windows.h>
#include		<errno.h>

int order_arr(int* arr, int len);

int main()
{
	int arr[] = { 1,1,1,1,1,1,1,1};
	int len = sizeof(arr) / sizeof(arr[0]);

	int output = order_arr(arr, len);
	printf("%d\n", output);
	return 0;
}



int order_arr(int* arr, int len)
{
	int cycle = len - 1;
	int recordup = 0;
	int recorddown = 0;
	while (cycle--)
	{
		if (arr[0] < arr[1])
		{
			recordup = 1;
		}
		else if (arr[0] > arr[1])
		{
			recorddown = 1;
		}
		else
		{

		}
		arr++;
	}

	if (recordup && recorddown)
		return 0;
	else if (recordup && recorddown==0)
		return 1;
	else if (recordup==0 && recorddown)
		return -1;
	else 
		return 2;
}






